
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
using System.Collections.Generic;
using System.Text;

using Swaf.Container;

namespace Swaf.Gui
{
	public interface IBizProcCoordinator
	{
		ViewOfflineState PageState { get; }
		BizProcOfflineState addBizProcOfflineState(BizProcOfflineState state);
		ActiveBizProc getActiveBizProc(string bizProcId);
		ActiveWidget getActiveWidget(string widgetId);
		void defineActiveWidget(ActiveWidget widget);
		List<IAction> getBizProcActions(string actionIds);
		BizProcOfflineState getBizProcOfflineState(string bizProcId);
		object getDataValueFromHostEnvironment(string dataId, ActiveBizProc bizProc);
		System.Collections.Generic.List<ActiveBizProc> getDependentBizProcs(string bizProcId);
		WidgetOfflineState getWidgetOfflineState(string widgetId);
		void removeActiveBizProc(string bizProcId);
		void removeBizProcOfflineState(string bizProcId);
		IBasicView HostView { get;}
		Dictionary<string, ActiveBizProc> ActiveBizProcs { get;}
		Dictionary<string, ActiveWidget> ActiveWidgets { get;}
		IMessanger Messenger { get;}
	}

	[Serializable]
	public class UserMessage
	{
		public string ArticleId;
		public INameAddressSupport ReplacementMacros;
		public UserMessage(string articleId, INameAddressSupport replacements)
		{ ArticleId = articleId; ReplacementMacros = replacements; }
	}

	public interface IMessanger
	{
		List<UserMessage> ActiveUserMessages { get;}
		void add(string msgId, INameAddressSupport replacements);
		void addRange(List<UserMessage> msgs);
		void clearAll();
	}
}
